package ModelLayer;


public class Product
{
    
    private String productName;
    private int inStock;
    private double price;
    private int productId;
    private Discount productDiscount;
    
    public Product(String productName, int inStock, double price, int id)
    {
      this.productName = productName;
      this.inStock = inStock;
      this.price = price;
      this.productId = id;
    }
    
    public void setDiscount(Discount productDiscount)
    {
        this.productDiscount = productDiscount;
    }
    
    public Discount getDiscount()
    {
        return productDiscount;
    }
    
    public int getDiscountAmount()
    {
        if(productDiscount == null)
    {
        return 0;
    }
    else
    {
        return productDiscount.getDiscountAmount();
    }
   }
   
    public void setProductName(String productName)
    {
        this.productName = productName;
    }
    
    public void setInStock(int inStock)
    {
        this.inStock = inStock;
    }
    
    public void setPrice(double price)
    {
        this.price = price;
    }
    
    public String getProductName()
    {
        return productName;
    }
    
    public long getInStock()
    {
        return inStock;
    }
    
    public double getPrice()
    {
        return price;
    }
    
    public int getId()
    {
        return productId;
    }
}
